﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Loader;
using System.Text;
using System.Threading.Tasks;

namespace StarryEdge.Domains
{
    public class MenuUpdate : StarryEdge.Core.IMenuUpdate
    {
        private Func<bool> _action;
        private Func<bool> _actionHandle;
        private Func<int, bool> _actionParameter;

        public MenuUpdate(Func<bool> action, Func<bool> handle, Func<int, bool> parameter) 
        { 
            _action = action;
            _actionHandle = handle;
            _actionParameter = parameter;
        }

        public bool UpdateHandle() => _actionHandle.Invoke();

        public bool UpdateMenu() => _action.Invoke();

        public bool UpdateParameter(int type) => _actionParameter.Invoke(type);
    }
}
